#ifndef GLGUIEVENTRECOGNIZER_H
#define GLGUIEVENTRECOGNIZER_H
#include <ooputils/Singleton.hpp>
#include <oopgl_base/GlEvent.hpp>
#include "GlWidget.h"



class GlGuiEventRecognizer : public Singleton< GlGuiEventRecognizer >
{

  friend class Singleton< GlGuiEventRecognizer >;

private:

  GlEvent _lastEvent;
  GlEvent _curEvent;

  GlGuiEventRecognizer (); 

public:

  /**************************************************************************************************
   * <summary>  Tell recognizer a new event has been raised. </summary>
   *
   * <remarks>  Deng Nianchen, 2011/3/21. </remarks>
   *
   * <param name="e"> The gui event object. </param>
   **************************************************************************************************/

  void newEventRaised (const GlEvent & e);

  /**************************************************************************************************
   * <summary>  Detect whether the widget should raise the event
   * 						specified by eventType. </summary>
   *
   * <remarks>  Deng Nianchen, 2011/3/21. </remarks>
   *
   * <param name="eventType"> Type of the event. </param>
   * <param name="widget">    Pointer to a widget. </param>
   *
   * <returns>  Detection result. </returns>
   **************************************************************************************************/

  bool shouldEventRaised (int eventType, GlWidget * pWidget); 

};  //end class GlGuiEventRecognizer



#endif
